import { wechatrequest } from './API/request'

/**
 * 存储用户地址信息
 */
export const saveJobAddressRequest = submitData => {
  return wechatrequest.postform('/company/insertCompanyWorkLocation', {
    data: submitData
  })
}

/**
 * 获取用户地址信息
 */
export const getJobAddressRequest = ({ companyId, userId }) => {
  return wechatrequest.postparams('/company/getPostWorkLocationList', {
    data: { companyId, userId, limit: 100 }
  })
}

/**
 * 删除用户地址信息
 */
export const deleteJobAddressRequest = ({ ids, userId }) => {
  return wechatrequest.postparams('/company/deleteCompanyWorkLocationByIds', {
    data: { ids, userId }
  })
}

/**
 * 获取订单列表
 */
export const getOrderList = ({ page = 1, limit = 10, userId }) => {
  return wechatrequest.postparams(`/company/getMyOrderList`, {
    data: {
      userId,
      limit,
      page
    }
  })
}

/**
 * 获取人才沟通剩余次数
 */
export const getTalentTalkTimeRequest = ({ companyId }) => {
  return wechatrequest.postparams(`/company/talentTalkTime`, {
    data: { companyId }
  })
}
/**
 * 获取会员状态
 */
export const getVipStatusRequest = ({ companyId }) => {
  return wechatrequest.postparams(`/company/getCompanyMemberInfo`, {
    data: {
      companyId
    }
  })
}

/**
 * 企业未处理的岗位消息
 */
export const getCompanyMessageRequest = () => {
  return wechatrequest.postparams(`/company/getCompanyPostMessageList`, {
    data: {}
  })
}
/**
 * 清空企业未处理的岗位消息
 */
export const clearCompanyMessageRequest = ({ companyId }) => {
  return wechatrequest.postparams(`/company/clearCompanyPostMessage`, {
    data: {
      companyId
    }
  })
}
/**
 * 重置未查看异常岗位数量
 */
export const resetExceptionPostNumberRequest = ({ companyId }) => {
  return wechatrequest.postparams(`/company/resetUnLookExceptionPostNumber`, {
    data: {
      companyId
    }
  })
}
